<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <title>TurboDX AI 智能搜索系统 - 功能导航</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
    <style>
        body {
            margin: 0;
            padding: 20px;
            font-family: Arial, sans-serif;
            background: linear-gradient(-45deg, #0A2463, #3E92CC, #2CA58D, #84B082);
            background-size: 400% 400%;
            animation: gradient 15s ease infinite;
            min-height: 100vh;
            box-sizing: border-box;
        }

        @keyframes gradient {
            0% {
                background-position: 0% 50%;
            }

            50% {
                background-position: 100% 50%;
            }

            100% {
                background-position: 0% 50%;
            }
        }

        .nav-container {
            max-width: 1200px;
            margin: 0 auto;
        }

        .header {
            background: rgba(255, 255, 255, 0.95);
            padding: 20px;
            border-radius: 15px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.3);
            margin-bottom: 30px;
            text-align: center;
        }

        .nav-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 20px;
            padding: 20px 0;
        }

        .nav-item {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.3);
            padding: 25px;
            border-radius: 15px;
            text-decoration: none;
            color: #333;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
        }

        .nav-item:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
        }

        .nav-item::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg,
                    transparent,
                    rgba(255, 255, 255, 0.2),
                    transparent);
            transition: 0.5s;
        }

        .nav-item:hover::before {
            left: 100%;
        }

        .nav-item-header {
            display: flex;
            align-items: center;
            gap: 15px;
            margin-bottom: 15px;
        }

        .nav-item-icon {
            width: 50px;
            height: 50px;
            background: #1890ff;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 24px;
            position: relative;
        }

        .nav-item-icon::after {
            content: '';
            position: absolute;
            width: 100%;
            height: 100%;
            background: rgba(24, 144, 255, 0.2);
            border-radius: 12px;
            filter: blur(15px);
            z-index: -1;
            opacity: 0;
            transition: opacity 0.3s;
        }

        .nav-item:hover .nav-item-icon::after {
            opacity: 1;
        }

        .nav-item-content {
            color: #666;
            line-height: 1.6;
            font-size: 14px;
        }

        h1 {
            margin: 0;
            color: #1890ff;
            font-size: 32px;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }

        h2 {
            margin: 0;
            font-size: 20px;
            color: #333;
        }

        .header-content {
            display: flex;
            justify-content: space-between;
            align-items: center;
            max-width: 1200px;
            margin: 0 auto;
        }

        .logout-btn {
            padding: 8px 20px;
            background: linear-gradient(45deg, #ff4d4f, #f5222d);
            color: white;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 14px;
            backdrop-filter: blur(5px);
            box-shadow: 0 4px 15px rgba(255, 77, 79, 0.2);
        }

        .logout-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(255, 77, 79, 0.3);
        }

        .logout-btn i {
            font-size: 16px;
        }

        .header-actions {
            display: flex;
            align-items: center;
            gap: 16px;
        }

        .theme-switcher {
            position: relative;
        }

        .theme-btn {
            padding: 8px 20px;
            background: linear-gradient(45deg, #1890ff, #52c41a);
            color: white;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 14px;
            backdrop-filter: blur(5px);
            box-shadow: 0 4px 15px rgba(24, 144, 255, 0.2);
        }

        .theme-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(24, 144, 255, 0.3);
        }

        .theme-menu {
            position: absolute;
            top: 100%;
            right: 0;
            margin-top: 8px;
            background: white;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            padding: 8px;
            display: none;
            z-index: 1000;
            min-width: 150px;
        }

        .theme-menu.show {
            display: block;
            animation: fadeIn 0.2s ease-out;
        }

        .theme-option {
            padding: 8px 16px;
            border-radius: 6px;
            cursor: pointer;
            margin-bottom: 4px;
            color: white;
            transition: transform 0.2s;
        }

        .theme-option:hover {
            transform: translateX(4px);
        }

        .theme-option:last-child {
            margin-bottom: 0;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(-10px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* 主题相关的CSS变量 */
        :root {
            --theme-gradient: linear-gradient(-45deg, #0A2463, #3E92CC, #2CA58D, #84B082);
            --primary-color: #1890ff;
            --secondary-color: #52c41a;
        }

        /* 紫色主题 */
        [data-theme="purple"] {
            --theme-gradient: linear-gradient(-45deg, #4A148C, #7B1FA2, #9C27B0, #BA68C8);
            --primary-color: #7B1FA2;
            --secondary-color: #9C27B0;
        }

        /* 绿色主题 */
        [data-theme="green"] {
            --theme-gradient: linear-gradient(-45deg, #1B5E20, #388E3C, #4CAF50, #81C784);
            --primary-color: #388E3C;
            --secondary-color: #4CAF50;
        }

        /* 橙色主题 */
        [data-theme="orange"] {
            --theme-gradient: linear-gradient(-45deg, #E65100, #F57C00, #FF9800, #FFB74D);
            --primary-color: #F57C00;
            --secondary-color: #FF9800;
        }

        /* 使用CSS变量 */
        body {
            background: var(--theme-gradient);
        }

        .nav-item-icon {
            background: var(--primary-color);
        }

        h1 {
            color: var(--primary-color);
        }

        /* 移除原来的theme-menu相关样式，添加新的弹出框样式 */
        .theme-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(5px);
            z-index: 1000;
            animation: fadeIn 0.3s ease-out;
        }

        .theme-modal-content {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: white;
            padding: 24px;
            border-radius: 16px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
            width: 90%;
            max-width: 600px;
        }

        .theme-modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }

        .theme-modal-header h3 {
            margin: 0;
            font-size: 20px;
            color: #333;
        }

        .close-btn {
            background: none;
            border: none;
            font-size: 20px;
            color: #999;
            cursor: pointer;
            padding: 4px;
            transition: all 0.3s;
        }

        .close-btn:hover {
            color: #333;
            transform: rotate(90deg);
        }

        .theme-options {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
            gap: 16px;
        }

        .theme-card {
            cursor: pointer;
            text-align: center;
            transition: all 0.3s;
            padding: 8px;
            border-radius: 8px;
        }

        .theme-card:hover {
            background: #f5f5f5;
            transform: translateY(-4px);
        }

        .theme-preview {
            height: 80px;
            border-radius: 8px;
            margin-bottom: 8px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        .theme-name {
            font-size: 14px;
            color: #666;
        }

        .theme-card[data-theme="default"] .theme-preview {
            background: var(--theme-gradient);
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
            }

            to {
                opacity: 1;
            }
        }

        /* 修改主题按钮样式 */
        .theme-btn {
            padding: 8px 20px;
            background: linear-gradient(45deg, #1890ff, #52c41a);
            color: white;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 14px;
            backdrop-filter: blur(5px);
            box-shadow: 0 4px 15px rgba(24, 144, 255, 0.2);
        }

        .theme-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(24, 144, 255, 0.3);
        }
    </style>
</head>

<body>
    <div class="nav-container">
        <div class="header">
            <div class="header-content">
                <h1>TurboDX AI 智能搜索系统</h1>
                <div class="header-actions">
                    <button class="theme-btn" onclick="showThemeModal()">
                        <i class="fas fa-palette"></i>
                        主题切换
                    </button>
                    <button class="logout-btn" onclick="handleLogout()">
                        <i class="fas fa-sign-out-alt"></i>
                        退出登录
                    </button>
                </div>
            </div>
        </div>

        <div class="nav-grid">
            <a href="data-search.html" class="nav-item">
                <div class="nav-item-header">
                    <div class="nav-item-icon">
                        <i class="fas fa-database"></i>
                    </div>
                    <h2>数据供需探查</h2>
                </div>
                <div class="nav-item-content">
                    在指定范围内，寻找含有指定字段的数据资源，支持关联多个数据资源的整合方案。
                </div>
            </a>

            <a href="business-search.html" class="nav-item">
                <div class="nav-item-header">
                    <div class="nav-item-icon">
                        <i class="fas fa-chart-line"></i>
                    </div>
                    <h2>业务数据探查</h2>
                </div>
                <div class="nav-item-content">
                    在全部或指定范围内，寻找业务流程、业务环节、数据表、表字段等的相关信息。
                </div>
            </a>
        </div>
    </div>

    <div id="themeModal" class="theme-modal">
        <div class="theme-modal-content">
            <div class="theme-modal-header">
                <h3>选择主题</h3>
                <button class="close-btn" onclick="closeThemeModal()">
                    <i class="fas fa-times"></i>
                </button>
            </div>
            <div class="theme-options">
                <div class="theme-card" onclick="changeTheme('default')" data-theme="default">
                    <div class="theme-preview" style="background: linear-gradient(-45deg, #0A2463, #3E92CC)"></div>
                    <div class="theme-name">默认主题</div>
                </div>
                <div class="theme-card" onclick="changeTheme('purple')" data-theme="purple">
                    <div class="theme-preview" style="background: linear-gradient(-45deg, #4A148C, #7B1FA2)"></div>
                    <div class="theme-name">紫色主题</div>
                </div>
                <div class="theme-card" onclick="changeTheme('green')" data-theme="green">
                    <div class="theme-preview" style="background: linear-gradient(-45deg, #1B5E20, #388E3C)"></div>
                    <div class="theme-name">绿色主题</div>
                </div>
                <div class="theme-card" onclick="changeTheme('orange')" data-theme="orange">
                    <div class="theme-preview" style="background: linear-gradient(-45deg, #E65100, #F57C00)"></div>
                    <div class="theme-name">橙色主题</div>
                </div>
            </div>
        </div>
    </div>

    <script>
        // 检查登录状态
        function checkLogin() {
            if (!sessionStorage.getItem('isLoggedIn')) {
                window.location.href = 'index.html';
            }
        }

        // 处理退出登录
        function handleLogout() {
            // 清除登录状态
            sessionStorage.removeItem('isLoggedIn');
            // 跳转到登录页
            window.location.href = 'index.html';
        }

        // 页面加载时检查登录状态
        window.addEventListener('load', checkLogin);

        function showThemeModal() {
            document.getElementById('themeModal').style.display = 'block';
            document.body.style.overflow = 'hidden'; // 防止背景滚动
        }

        function closeThemeModal() {
            document.getElementById('themeModal').style.display = 'none';
            document.body.style.overflow = 'auto';
        }

        function changeTheme(theme) {
            document.body.setAttribute('data-theme', theme);
            localStorage.setItem('selected-theme', theme);
            closeThemeModal();

            // 高亮当前选中的主题
            document.querySelectorAll('.theme-card').forEach(card => {
                card.style.background = card.getAttribute('data-theme') === theme ? '#f0f0f0' : '';
            });
        }

        // 点击弹窗外部关闭弹窗
        document.getElementById('themeModal').addEventListener('click', function (event) {
            if (event.target === this) {
                closeThemeModal();
            }
        });

        // 页面加载时检查并应用保存的主题
        document.addEventListener('DOMContentLoaded', function () {
            const savedTheme = localStorage.getItem('selected-theme');
            if (savedTheme) {
                document.body.setAttribute('data-theme', savedTheme);
                // 高亮保存的主题
                document.querySelectorAll('.theme-card').forEach(card => {
                    card.style.background = card.getAttribute('data-theme') === savedTheme ? '#f0f0f0' : '';
                });
            }
        });
    </script>
</body>

</html>